package com.flca.pstc42.dbs;

import org.garret.perst.FieldIndex;
import org.garret.perst.Persistent;
import org.garret.perst.Storage;

import com.flca.pstc42.dto.CityDto;
import com.flca.pstc42.dto.PostcodesDto;
import com.flca.pstc42.dto.StreetDto;

public class MyRootClass extends Persistent {

    public FieldIndex<CityDto> cityPk;  
    public FieldIndex<StreetDto> streetPk;  
    public FieldIndex<PostcodesDto> postcodePk;  
    public FieldIndex<PostcodesDto> geoLatFk;
    public FieldIndex<PostcodesDto> geoLngFk;
    
    public MyRootClass(Storage db) 
    { 
        super(db);
        cityPk = db.<CityDto>createFieldIndex(CityDto.class, "cityId", true); // unique index
        streetPk = db.<StreetDto>createFieldIndex(StreetDto.class, "streetId", true); // unique index
        postcodePk = db.<PostcodesDto>createFieldIndex(PostcodesDto.class, "postcode", false); // not unique index
        geoLatFk = db.<PostcodesDto>createFieldIndex(PostcodesDto.class, "lat", false);
        geoLngFk = db.<PostcodesDto>createFieldIndex(PostcodesDto.class, "lng", false);
    }

}
